package com.wing.bill.model.enums;

import lombok.Getter;

@Getter
public enum OrderStatusEnum {
    REVOKED(0, "已撤销"),
    TO_BE_ACCEPTED(1,"待受理"),
    HAS_ACCEPTED(3,"已受理"),
    ;


    private final Integer code;
    private final String desc;

    OrderStatusEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static String getDescByCode(Integer source) {
        for (OrderStatusEnum value : OrderStatusEnum.values()) {
            if (value.code.equals(source)) {
                return value.desc;
            }
        }
        return null;
    }
}
